#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include  <stdbool.h>

double f1(int idx,double x)
{
    if(idx==1)
        return x*x*x-x*x-1;
    if(idx==2)
        return x*x*x*x-3*x+1;
    if(idx==3)
        return x-exp(-x);
}
double f2(int idx,double x)
{
    if(idx==1)
        return 3*x*x-2*x;
    if(idx==2)
        return 4*x*x*x-3;
    if(idx==3)
        return 1+exp(-x);
}
int main()
{
    int idx;
    while(scanf("%d",&idx)!=EOF)
    {
        double x,a,n1,n2,y;
        scanf("%lf %lf",&x,&a);
            while(1)
            {
                n1=f1(idx,x);
                n2=f2(idx,x);
                y=x-n1/n2;
                if(fabs(y-x)<a)
                {
                    break;
                }
                x=y;
            }
            printf("%d %.2e %.5lf\n",idx,a,y);
    }
    return 0;
}
